Skip to content

feat: add durable goal loop#14

Merged
woai3c merged 5 commits into
mainfrom
feat/goal-loop-engineering
Jul 11, 2026
Merged

feat: add durable goal loop#14
woai3c merged 5 commits into
mainfrom
feat/goal-loop-engineering

Conversation

@woai3c

@woai3c woai3c commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a durable /goal loop engineering implementation for x-code-cli. Goals are session-scoped, persisted, resumable, interruptible, and can complete only through verifier evidence or explicit user confirmation.

What changed

  • Added core goal state, input queue, coordinator, runner, continuation prompts, final summaries, and durable session persistence.
  • Added getGoal / updateGoal tools and CLI commands for create, status, pause, resume, cancel, clear, edit, steer, and verify.
  • Added shell, file, sub-agent, and user-confirmation verifier paths.
  • Stops each inner agent loop immediately after a goal transition so the host runner controls retries and terminal state.
  • Blocks no-verifier and unsafe sub-agent verifier configurations instead of looping indefinitely.
  • Enforces token budgets after each outer turn and reports remaining budget in /goal status.
  • Uses semantic blocker matching so equivalent blocker reports converge after three outer turns.
  • Keeps slash control commands usable while permission and selection dialogs are open.
  • Preserves /clear history behavior while clearing the current viewport.
  • Fixes long Markdown/tool-output rendering so bottom table borders are retained.
  • Adds a root Vitest alias for @x-code-cli/core, so pnpm test works in a clean checkout without prebuilt core dist.

Risk areas reviewed

  • Goal transitions cannot trigger repeated updateGoal calls inside one agent turn.
  • Goal creation is rejected while a non-terminal goal exists.
  • Resume, pause, cancel, and clear drain pending interactive requests.
  • Missing or non-retryable verifiers terminate as blocked.
  • Shell verifiers receive the shared abort signal and pass through permission checks.
  • Sub-agent verifiers cannot recurse and destructive verification prompts are rejected.
  • Long content commits reserve terminal frame rows before repainting.
  • Test resolution no longer depends on generated artifacts left by a prior build.

Verification

  • pnpm run ci
  • pnpm format:check
  • Clean-dist pnpm test: 73 files, 822 passed, 4 skipped
  • Targeted clean-dist CI regression suites: 12 passed
  • Manual checklist and terminal/debug logs reviewed, including verifier retry, blocker convergence, /clear, and long-table rendering

Manual testing

The checklist is at tmp/goal-loop-manual-test-plan.md.

@woai3c woai3c merged commit 37a98c0 into main Jul 11, 2026
5 checks passed
@woai3c woai3c deleted the feat/goal-loop-engineering branch July 11, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant